package com.sc.nft.dao;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.MallUserPropsReleasedDetail;
import com.sc.nft.mapper.MallUserPropsReleasedDetailMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Slf4j
@Repository
public class MallUserPropsReleasedDetailDao extends ServiceImpl<MallUserPropsReleasedDetailMapper, MallUserPropsReleasedDetail> {


    /**
     * 查最新的一条释放记录
     *
     * @param userId
     * @param propsId
     * @param daoId
     * @return
     */
    public MallUserPropsReleasedDetail getLastReleasedDetail(Long userId,
                                                             Long propsId,
                                                             Long daoId) {
        return baseMapper.getLastReleasedDetail(userId, propsId, daoId);
    }

    /**
     * 查汇总数据
     *
     * @param userId
     * @param propsIds
     * @param daoId
     * @return
     */
    public MallUserPropsReleasedDetail getReleasedSummary(Date startTime,
                                                                Date endTime,
                                                                Long userId,
                                                                Long daoId,
                                                                List<Long> propsIds) {
        return baseMapper.getReleasedSummary(startTime, endTime, userId, daoId, propsIds);
    }


    /**
     * 查汇总数据
     *
     * @param userId
     * @param propsIds
     * @param daoId
     * @return
     */
    public List<MallUserPropsReleasedDetail> getReleasedSummaryList(Date startTime,
                                                                    Date endTime,
                                                                    Long userId,
                                                                    Long daoId,
                                                                    List<Long> propsIds) {
        return baseMapper.getReleasedSummaryList(startTime, endTime, userId, daoId, propsIds);
    }



}
